package com.dragon.logical.service.contract;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dragon.repository.entity.AddPageData;
import com.dragon.repository.entity.Deliver;
import com.dragon.repository.entity.DeliverProducts;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author sy
 * @since 2023-06-26
 */
public interface DeliverService extends IService<Deliver> {

    Page<Deliver> deliverList(String search, Integer status, Integer page,  Integer limit, Integer type);


    @Transactional(rollbackFor = RuntimeException.class)
    void addDeliver(Deliver deliver);

    void addRejectedDeliver(Deliver deliver);

    void update(Deliver deliver);

    void delete(Integer id);

    List<Deliver> selectByContractId(Integer contractId);

    Deliver listByDeliverId(Integer id);

    String selectCustomerAddressByContractId(Integer contractId);

    void updateStatus(Deliver deliver);

    List<DeliverProducts> selectDeliverProductById(Integer id);

    void exportExcel(Integer id, HttpServletResponse response)throws UnsupportedEncodingException;

    /**
     * 合同总信息之送货
     * @param page
     * @param limit
     * @param contractId
     * @return
     */
    Page<Deliver> informationOfDeliver(Integer page, Integer limit, Integer contractId);
}
